package com.health.record.service.impl;

import java.util.List;
import com.health.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.health.record.mapper.MedicalAppointmentDetailMapper;
import com.health.record.domain.MedicalAppointmentDetail;
import com.health.record.service.IMedicalAppointmentDetailService;

/**
 * 预约Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-30
 */
@Service
public class MedicalAppointmentDetailServiceImpl implements IMedicalAppointmentDetailService 
{
    @Autowired
    private MedicalAppointmentDetailMapper medicalAppointmentDetailMapper;

    /**
     * 查询预约
     * 
     * @param detailId 预约主键
     * @return 预约
     */
    @Override
    public MedicalAppointmentDetail selectMedicalAppointmentDetailByDetailId(Long detailId)
    {
        return medicalAppointmentDetailMapper.selectMedicalAppointmentDetailByDetailId(detailId);
    }

    /**
     * 查询预约列表
     * 
     * @param medicalAppointmentDetail 预约
     * @return 预约
     */
    @Override
    public List<MedicalAppointmentDetail> selectMedicalAppointmentDetailList(MedicalAppointmentDetail medicalAppointmentDetail)
    {
        return medicalAppointmentDetailMapper.selectMedicalAppointmentDetailList(medicalAppointmentDetail);
    }

    /**
     * 新增预约
     * 
     * @param medicalAppointmentDetail 预约
     * @return 结果
     */
    @Override
    public int insertMedicalAppointmentDetail(MedicalAppointmentDetail medicalAppointmentDetail)
    {
        medicalAppointmentDetail.setCreateTime(DateUtils.getNowDate());
        return medicalAppointmentDetailMapper.insertMedicalAppointmentDetail(medicalAppointmentDetail);
    }

    /**
     * 修改预约
     * 
     * @param medicalAppointmentDetail 预约
     * @return 结果
     */
    @Override
    public int updateMedicalAppointmentDetail(MedicalAppointmentDetail medicalAppointmentDetail)
    {
        medicalAppointmentDetail.setUpdateTime(DateUtils.getNowDate());
        return medicalAppointmentDetailMapper.updateMedicalAppointmentDetail(medicalAppointmentDetail);
    }

    /**
     * 批量删除预约
     * 
     * @param detailIds 需要删除的预约主键
     * @return 结果
     */
    @Override
    public int deleteMedicalAppointmentDetailByDetailIds(Long[] detailIds)
    {
        return medicalAppointmentDetailMapper.deleteMedicalAppointmentDetailByDetailIds(detailIds);
    }

    /**
     * 删除预约信息
     * 
     * @param detailId 预约主键
     * @return 结果
     */
    @Override
    public int deleteMedicalAppointmentDetailByDetailId(Long detailId)
    {
        return medicalAppointmentDetailMapper.deleteMedicalAppointmentDetailByDetailId(detailId);
    }
}
